<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui">
	<ui:composition template="/design/template.xhtml">
    <ui:define name="body">

      <h:form id="frmLogin" acceptcharset="ISO-8859-1">
      <p:panel id="pnlLogin" header="Login usuário">

        <p:spacer height="10" />
        <p:messages id="messages" autoUpdate="true" />

        <h:panelGrid columns="3" cellpadding="4" >

          <h:outputLabel value="E-mail:" for="emailUsuario" />
          <p:spacer width="8" />
          <p:inputText id="emailUsuario" value="#{loginAction.usuario.email}" 
            required="true" size="50"
            requiredMessage="E-mail obrigatório!" 
            validatorMessage="E-mail inválido!">
            <f:validator validatorId="emailValidator" />
          </p:inputText>
      
          <h:outputLabel value="Senha:" for="senhaUsuario" />
          <p:spacer width="8" />
          <p:password id="senhaUsuario" value="#{loginAction.usuario.senhaAcesso}" 
            required="true" feedback="false" size="20"
            requiredMessage="Senha obrigatória!" 
            validatorMessage="Senha inválida!">
            <f:validateLength maximum="8" minimum="6"></f:validateLength>
          </p:password>

        </h:panelGrid>
        
      <p:spacer height="10" />
      <p:outputPanel id="pnlButons">
        <div align="left" id="divButons">
          <p:commandButton action="#{usuarioAction.iniciar}" update="pnlLogin" value="cancelar" ajax="false" immediate="true" />
          <p:spacer width="10" />
          <p:commandButton action="#{loginAction.executarLogin}" update="pnlLogin" value="confirmar" ajax="false" accesskey="enter" />
        </div>
      </p:outputPanel>
      
    </p:panel>
    </h:form>

  </ui:define>
  </ui:composition>
</html>
